package com.wiscamp.ninechapters.panels.infrastructure.converters;


import com.wiscamp.ninechapters.panels.domain.entities.Group;
import com.wiscamp.ninechapters.panels.infrastructure.po.GroupPO;
import com.wiscamp.ninechapters.panels.infrastructure.views.GroupView;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface GroupConverter {
    GroupConverter Instance = Mappers.getMapper(GroupConverter.class);

    Group toGroup(GroupPO po);

    Group toGroupByView(GroupView view);

    GroupPO toGroupPO(Group entity);

    GroupPO toGroupPO(Group entity, @MappingTarget GroupPO po);

}
